<!DOCTYPE html>
<html lang="en">

<head>
    <title>表格练习</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="./vue.js"></script>

</head>

<body>
    <div id="app">
        {{data}}<br>
        {{date | changeTime}}
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data: {
                data: '2017 - 02 - 01',
                date: new Date()
            },
            filters: {
                changeTime: function (val) {
                    // let date = new Date();
                    let year = val.getFullYear();
                    let month = val.getMonth();
                    let day = val.getDate();
                    return year + '-' + month + '-' + day
                }
            }

        });
    </script>
</body>

</html>